package C;

import java.util.Scanner;

public class C27 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] cache = new int[n+1];
        System.out.println(getResult(cache,n));

    }

    public static int getResult(int[] cache,int n) {
        if (n>=1) cache[1] = 1;
        if (n>=2) cache[2] = 1;
        if (n>=3) cache[3] = 2;
        if (n>=4) {
            for (int i=4;i<=n;i++) {
                cache[i] = cache[i-1]+cache[i-3];
            }
        }
        return cache[n];
    }
}
